var rss_google = 'http://fusion.google.com/add?feedurl='+domain+'/rss';
var rss_xianguo = 'http://www.xianguo.com/subscribe.php?url='+domain+'/rss';
var rss_qq = 'http://mail.qq.com/cgi-bin/feed?u='+domain+'/rss';
var rss_douban = 'http://9.douban.com/reader/subscribe?url='+domain+'/rss';
var rss_zhuaxia = 'http://www.zhuaxia.com/add_channel.php?url='+domain+'/rss';
$(function(){
	$('.rss-tag').rssTag();
	$('.rss-user').rssUser();
	$("#tag-input").bind('keyup',function(){
		setTagInputRss(this.value);
	});
	$("#user-input").bind('keyup',function(){
		setUserInputRss(this.value);
	});
});
$.fn.rssTag = function(){
	return this.each(function(){
		$(this).bind('click',function(){
			setTagInputRss(this.rel);
		});	
	});
}
$.fn.rssUser = function(){
	return this.each(function(){
		$(this).bind('click',function(){
			setUserInputRss(this.rel);
		});	
	});
}
function $id(id){
	return document.getElementById(id);
}
function setTagInputRss(tag){
	$id("tag-input-rss").value=domain+"/rss/tag/"+tag;
	$id("tag-google-a").href=rss_google+"/tag/"+tag;
	$id("tag-xianguo-a").href=rss_xianguo+"/tag/"+tag;
	$id("tag-qq-a").href=rss_qq+"/tag/"+tag;
	$id("tag-douban-a").href=rss_douban+"/tag/"+tag;
	$id("tag-zhuaxia-a").href=rss_zhuaxia+"/tag/"+tag;
}
function setUserInputRss(user){
	$id("user-input-rss").value=domain+"/rss/user/"+user;
	$id("user-google-a").href=rss_google+"/user/"+user;
	$id("user-xianguo-a").href=rss_xianguo+"/user/"+user;
	$id("user-qq-a").href=rss_qq+"/user/"+user;
	$id("user-douban-a").href=rss_douban+"/user/"+user;
	$id("user-zhuaxia-a").href=rss_zhuaxia+"/user/"+user;
}